package com.meteor.user.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import com.meteor.user.entity.SysMerchant;
import com.meteor.user.entity.SysOrg;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import com.meteor.framework.common.utils.DateUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 角色管理
 *
 * @author lynn
 * @date 2024/1/03
 */
@Data
@Schema(description = "角色")
public class SysRoleVO implements Serializable, TransPojo {
    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    private String id;

    @Schema(description = "角色名称")
    @NotBlank(message = "角色名称不能为空")
    private String name;
    
    @Schema(description = "角色编码")
    @NotBlank(message = "角色编码不能为空")
    private String roleCode;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "商户名称")
    private String merchantName;

    @Schema(description = "商户id")
    @Trans(type = TransType.SIMPLE, target = SysMerchant.class, fields = "name", ref = "merchantName")
    private String merchantId;

    @Schema(description = "组织id")
    @Trans(type = TransType.SIMPLE, target = SysOrg.class, fields = "name", ref = "orgName")
    private String orgId;

    @Schema(description = "组织名称")
    private String orgName;

    @Schema(description = "数据范围  0：全部数据  1：本机构及子机构数据  2：本机构数据  3：本人数据  4：自定义数据")
    private Integer dataScope;

    @Schema(description = "菜单ID列表")
    private List<String> menuIdList;

    @Schema(description = "机构ID列表")
    private List<String> orgIdList;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    private Date createTime;

}